<template>
  <div class="custom-header-wrap">
    <el-button v-bind="btnConfig" @click="handleBtn">{{btnConfig.label}}</el-button>
  </div>
</template>

<script>
export default {
  name: 'CustomHeader',
  methods: {
    handleBtn() {
      this.params.context.componentParent.actionEvent( 'head-btn-click' )
    },
    getDisabled(btn) {
      const type = typeof btn.disabled
      if (type == 'function') {
        return btn.disabled(this.params.data)
      } else if (type == 'boolean') {
        return btn.disabled
      } else {
        return false
      }
    }
  },
  computed: {
    btnConfig() {
      return this.params.column?.colDef?.headBtn
    }
  },
  mounted() {}
}
</script>

<style lang="scss">
</style>